package com.example.combwyaq.utils;


import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.MultiTransformation;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.example.combwyaq.R;
import com.example.combwyaq.http.Api;

public class GlideUtils {
    public static void loadMatchImg(String url, ImageView img){
        Glide.with(img.getContext()).load(Api.FileUrl+url)
                .placeholder(R.drawable.cutdown_dialog_bg)
                .error(R.drawable.tt_default_image_error)
                .centerCrop()
                .into(img);
    }
    public static void loadCircleImg(String url, ImageView img){
        Glide.with(img.getContext())
                .load(Api.FileUrl+url)
                .error(R.drawable.tt_default_image_error)
                .apply(RequestOptions.bitmapTransform(new CircleCrop()))
                .into(img);
    }
//    public static void loadRoundImg(String url, ImageView img,int radius){
//        Glide.with(img.getContext())
//                .load(Api.FileUrl+url)
//                // 圆角效果
//                .into(img);
//    }
}